package com.zuipin.interview.baiyapeng.web.advice;

import com.zuipin.interview.baiyapeng.web.response.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class AdviceController {

    @ExceptionHandler(value = Exception.class)
    public ResponseResult handleException(Exception e) {
        System.err.println(e.getMessage());
        ResponseResult result = new ResponseResult();
        result.setError_code(50000);
        result.setError_message("server error");
        return result;
    }

}
